package com.zjk.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.sql.Timestamp;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.util.Locale;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ProductVO {
    private Integer id;
    private String productNum;
    private String productName;
    private String cityName;
    private Long departureTime;
    private String dateFormat;
    private String productPrice;
    private String productDesc;
    private Integer productStatus;

    public Product toProduct() {
//        // 修改为符合带"T"分隔符的日期时间格式模式，可按需补全秒等部分，这里先按原字符串格式示例
        Product product = new Product();
        product.setId(id);
        product.setProductNum(productNum);
        product.setProductName(productName);
        product.setCityName(cityName);
        product.setProductPrice(productPrice);
        product.setProductDesc(productDesc);
        product.setProductStatus(productStatus);
        product.setDepartureTime(new Timestamp(departureTime));
        return product;
    }
}
